package com.binhthuan.catechist.client.data.callback;

import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;

public abstract class DSCallback implements com.smartgwt.client.data.DSCallback {

    @Override
    public void execute(DSResponse response, Object rawData, DSRequest request) {
        if (response.getStatus() == DSResponse.STATUS_SUCCESS) {
            onSuccess();
        } else {
            onFailure(response, rawData);
        }
    }

    public abstract void onSuccess();

    public abstract void onFailure(DSResponse response, Object rawData);
}
